home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / etc / init.d / bootmisc.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2009-03-31  |  1.2 KB  |  59 lines

  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          bootmisc
  4. # Required-Start:    hostname $remote_fs
  5. # Required-Stop:
  6. # Should-Start:      udev
  7. # Default-Start:     S
  8. # Default-Stop:
  9. # Short-Description: Miscellaneous things to be done during bootup.
  10. # Description:       Some cleanup.  Note, it need to run after mountnfs-bootclean.sh.
  11. ### END INIT INFO
  12.  
  13. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  14. [ "$DELAYLOGIN" ] || DELAYLOGIN=yes
  15. . /lib/init/vars.sh
  16.  
  17. do_start () {
  18.     #
  19.     # If login delaying is enabled then create the flag file
  20.     # which prevents logins before startup is complete
  21.     #
  22.     case "$DELAYLOGIN" in
  23.       Y*|y*)
  24.         echo "System bootup in progress - please wait" > /var/lib/initscripts/nologin
  25.         ;;
  26.     esac
  27.  
  28.     # Create /var/run/utmp so we can login.
  29.     : > /var/run/utmp
  30.     if grep -q ^utmp: /etc/group
  31.     then
  32.         chmod 664 /var/run/utmp
  33.         chgrp utmp /var/run/utmp
  34.     fi
  35.  
  36.     # Remove bootclean's flag files.
  37.     # Don't run bootclean again after this!
  38.     rm -f /tmp/.clean /var/run/.clean /var/lock/.clean
  39. }
  40.  
  41. case "$1" in
  42.   start|"")
  43.     do_start
  44.     ;;
  45.   restart|reload|force-reload)
  46.     echo "Error: argument '$1' not supported" >&2
  47.     exit 3
  48.     ;;
  49.   stop)
  50.     # No-op
  51.     ;;
  52.   *)
  53.     echo "Usage: bootmisc.sh [start|stop]" >&2
  54.     exit 3
  55.     ;;
  56. esac
  57.  
  58. :
  59.